package t2h.listsong;

public final class Compatibility {
	public static boolean supportsIconCommands() {
        try {
            Class.forName("com.nokia.mid.ui.IconCommand"); //Try to produce the exception
            return true;
        } catch (ClassNotFoundException e) {
            return false;
        }
    }
	
	public static boolean supportsCategoryBar() {
        try {
            Class.forName("com.nokia.mid.ui.CategoryBar");

            return true;
        } catch (ClassNotFoundException e) {
            return false;
        }
    }
	public static boolean isFullTouch() {
        return supportsIconCommands() && supportsCategoryBar();
    }
	
	public static String toLowerCaseIfFT(String text) {
        return isFullTouch() ? text.toLowerCase() : text;
    }
	
	public static String[] toLowerCaseIfFT(String[] texts) {
	        for (int i = 0; i < texts.length; i++) {
	            texts[i] = toLowerCaseIfFT(texts[i]);
	        }
	        return texts;
	}
	 
	public static String toUpperCaseIfFT(String text) {
	        return isFullTouch() ? text.toUpperCase() : text;
	}
}
